package com.wyl.auth.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.wyl.auth.entity.SysUserRole;
import com.wyl.auth.mapper.SysUserRoleMapper;
import com.wyl.auth.service.SysUserRoleService;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
* @Description 系统用户角色表
* @Author WuYiLong
* @Date 2025-04-05
*/
@Service
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements SysUserRoleService {

    @Override
    public List<SysUserRole> getByUserId(Long userId) {
        LambdaQueryWrapper<SysUserRole> sysUserRoleWrapper = Wrappers.lambdaQuery(SysUserRole.class);
        sysUserRoleWrapper.eq(SysUserRole::getUserId, userId);
        List<SysUserRole> list = list(sysUserRoleWrapper);
        return list;
    }
}
